package com.lianniu.web.tea.pic.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lianniu.web.base.BaseResult;
import com.lianniu.web.baseService.dict.dao.IDictionaryDao;
import com.lianniu.web.tea.pic.dao.TeaSideshowPicDao;
import com.lianniu.web.tea.pic.model.TeaSideshowPicVo;
import com.lianniu.web.tea.pic.service.ITeaSideshowPicService;
@Service
@Transactional
public class TeaSideshowPicServiceImpl implements ITeaSideshowPicService {

	public static final Logger logger = Logger.getLogger(TeaSideshowPicServiceImpl.class);

	@Resource
	private TeaSideshowPicDao teaSideshowPicDao;
	
	@Resource
	private IDictionaryDao dictionaryDao;
	
	@Override
	public BaseResult getSideshowPicList() {
		logger.info("TeaSideshowPicServiceImpl getSideshowPicList start");
		String picNum = dictionaryDao.getDictValueByDictName("轮播图数量");
		logger.info("picNum:"+picNum);
		List<TeaSideshowPicVo> list = teaSideshowPicDao.getSideshowPicList(Integer.valueOf(picNum));
		logger.info("TeaSideshowPicServiceImpl getSideshowPicList end");
		return BaseResult.success(list);
	}

}
